package com.example.service;

import com.example.domain.OSSResult;
import com.example.security.exception.ServiceImplException;
import lombok.extern.slf4j.Slf4j;
import oj.common.core.enums.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@Slf4j
@Service
public class FileServiceImpl implements IFileService{
    @Autowired
    private OSSService ossService;
    @Override
    public OSSResult uploadFile(MultipartFile file) {
        try {
            return  ossService.uploadFile(file);
        } catch (Exception e) {
            throw new ServiceImplException(ResultCode.FAILED_FILE_UPLOAD);
        }
    }
}
